<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="java.io.*,java.util.*,java.net.*,java.text.*"%>
<%@ page import="com.yuxin.common.util.*" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%
    try{
        // 页面标题
        String url="";
        if(StringUtils.hasText(request.getParameter("url"))){
        	url = request.getParameter("url");
        }
        request.setAttribute("url",url);
        request.setAttribute("titleName",URLDecoder.decode("登录", "UTF-8"));
    }catch (Exception e){
        e.printStackTrace();
    }finally {
    }
%>
<html>
<head>
    <meta charset="utf-8" />
    <title>登录</title>
    <meta name="Keywords" content="中信信用卡平台" />
    <meta name="Description" content="登录"/>
    <meta name="robots" content="all"/>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta http-equiv="cleartype" content="on"/>
    <link rel="icon" type="image/png" href="images/favicon.ico">
    <%@ include file="/site/css.jsp" %>
</head>
<body>
<div id="page">
    <%@ include file="/site/header_nav.jsp" %>
    <div id="container">
        <form id="add_form" action="${ctx}/site/site.action.jsp?action=login" method="POST">
            <div style="line-height: 36px;margin-top:8px;">
                <label style="width:80px;display:inline-block;">用户名<span style="color:red;">*</span></label>
                <input class="text" autocomplete="0" id="USERNAME" name="USERNAME" placeholder="请输入用户名">
            </div>
            <div style="line-height: 36px;margin-top:8px;">
                <label style="width:80px;display:inline-block;">密码<span style="color:red;">*</span></label>
                <input class="text" autocomplete="0" id="PASSWORD" name="PASSWORD" placeholder="请输入密码" type="password">
            </div>
        </form>
        <div class="box-btn clearfix">
            <a href="javascript:void(0)" class="button big blue" onclick="login();return false;">登录</a>
        </div>
        <div class="box-btn clearfix">
            <a href="${ctx}/site/zhuce.jsp" class="button big green">快速注册</a>
        </div>
    </div>
    <%@ include file="/site/footer.jsp" %>
</div>
<%@ include file="/site/js.jsp" %>
<script src="${ctx}/site/js/jquery.form.js"></script>
<script>
    $('#add_form').ajaxForm({
        success:function(result,statusText,xhr,ele){
            if(result.isSuccess){
                appUtil.alert("登录成功！");
                setTimeout(function(){
                    window.location.href = "${url}";
                },1500);
            }else{
                appUtil.alert("登录失败："+result.error);
            }
        }
    });
    $(document).ready(function(){

    });
    /*** 保存登录信息 ***/
    function login(){
    	if($("#USERNAME").val().length < 1){
            appUtil.alert("请输入帐号！");
            $("#USERNAME").focus();
            return;
        }
        if($("#PASSWORD").val().length < 1){
            appUtil.alert("请输入密码！");
            $("#PASSWORD").focus();
            return;
        }
        $('#add_form').submit();
    }
</script>
</body>
</html>